﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using iMainAddin;

namespace iProjectAddin
{
    public class iAddProjectCommand : iCommand
    {
        public iAddProjectCommand()
            : base("iAddProject", "Addition Project")
        {
        }
        //public override void AddCommand(AddIn addinInstance)
        //{
        //    iCommandAssist.AddCommandEventHandler(Command, this.Execute);
        //}
        //public override void AddCommandMenu(CommandBarPopup ParantMenu, int Postion)
        //{
        //    CommandBarControl ProjectControl;
        //    if (ParantMenu == null)
        //    {
        //        ProjectControl = GetCommandBar("Solution").Controls.Add(MsoControlType.msoControlButton
        //            , Missing.Value, Missing.Value, 1, true);// as CommandBarPopup;
        //        ProjectControl.Tag = Id.ToString();
        //        ProjectControl.Caption = Caption;
        //        ProjectControl.TooltipText = TooltipText;
        //    }
        //    else
        //    {
        //        ProjectControl = ParantMenu.Controls.Add(MsoControlType.msoControlButton, Missing.Value, Missing.Value
        //            , 1, true);
        //        ProjectControl.Tag = Id.ToString();
        //        ProjectControl.Caption = Caption;
        //        ProjectControl.TooltipText = TooltipText;
        //    }
        //    iCommandAssist.AddClickEventHandler(ProjectControl, this.MenuItem_Click);
        //}
        #region 이벤트 처리기
        public override void Perform()
        {
            DialogResult Result = DialogResult.OK;
            try
            {
                iVCForm form = new iVCForm();
                Result = form.ShowDialog();
            }
            catch (Exception e)
            {
                MessageBox.Show("Failed Show Dialog \n" + "iCplusProjectForm Result :" + Result
                    + "\nException Message : " + e.Message);
            }

        }
        #endregion
    }
}
